//查找数组的最大数与最小数并显示，var arr=[3322,245,387,2,1246]
var arr=[3322,245,387,2,1246]
var max=(min=arr[0]);
for (var i= 1; i < arr.length; i++) {
    if (arr[i]>max) {
        max = arr[i];
    }
    if (arr[i]<min) {
        min = arr[i];
    }
}
console.log("最大的数："+max);
console.log("最小的数："+min);
